﻿@using FCZLM.Core.Models
@using Microsoft.AspNetCore.Http
@{
     var prolist = ViewBag.Product as List<Products>;
     var procategorylist = ViewBag.ProductCategory as List<ProductCategorys>;
     var prourllist = ViewBag.ProductUrl as List<ProductUrls>;
     var proMessage = ViewBag.ProductMessage as List<ProductMessage>;
     var user =ViewBag .User;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <link type="text/css" href="css/css.css" rel="stylesheet" />
<link href="~/layui/css/layui.css" rel="stylesheet" />
<script src="~/layui/layui.js"></script>
<script type="~/text/javascript" src="js/jquery.js"></script>
<script type="~/text/javascript" src="js/js.js"></script>
<script src="~/js/wb.js" type="text/javascript" charset="utf-8"></script>
<script src="~/js/MagicZoom.js" type="text/javascript"></script>
</head>
<body>  
  <div class="pnt">
   <div class="pntLeft">
    <h2 class="Title">所有商品分类
    </h2>
   </div><!--pntLeft/-->
   <div class="pntRight">
    <ul class="nav">
     <li><a href="/home/index">商城首页</a></li>
     <li class="navCur"><a href="/Product/index">商品中心</a></li>
     <li><a href="/news/index">新闻中心</a></li>
     <li>  @if(@Context.Session.GetString(key:"user")==null){
							 <a href="/login/index">用户中心</a>
						}else{
							
							 <a href="/user/index">用户中心</a>
							
						}   </li>
     <li><a href="/contact/index">联系我们</a></li>
     <div class="clears"></div>
     <div class="phone">TEL：021-12345678</div>
    </ul><!--nav/-->
   </div><!--pntRight/-->
   <div class="clears"></div>
  </div><!--pnt/-->
  <div class="positions">
   当前位置：<a href="index.html">首页</a> &gt; <a href="#" class="posCur">商品中心</a>
  </div><!--positions/-->
  <div class="cont">
   <div class="contLeft">
    <ul class="InPorNav">
                    @foreach (var item in procategorylist)
                    {
                        if (@item.Id < 1006)
                        {
                            <li><a href="/Product2/index/@item.Id">@item.Name</a></li>
                        }
                    }

                </ul><!--InPorNav/-->
   </div><!--contLeft/-->
   <div class="contRight" style="border:0;">
   <div class="proBox">
   <div id="tsShopContainer">
	<div id="tsImgS">
          <a href="@Model.PicUrl" title="Images" class="MagicZoom" id="MagicZoom">
            <img width="300" height="300" src="@Model.PicUrl" />
            </a>
        </div>
		<img class="MagicZoomLoading" width="16" height="16" src="images/loading.gif" alt="Loading..." />
    <script src="js/ShopShow.js"></script>
    </div><!--tsShopContainer/-->
    <div class="proBoxRight">
     <h3 class="proTitle">@Model.Product.Name</h3>
     <div>商品编号： @Model.Product.Id </div>
     <div>会员价：<strong class="red">¥@Model.Product.Price</strong> </div>
     <div>单位：袋 </div>
     <div>库存：<strong class="red">[有货] </strong> </div>
     <ul class="rongliang">
      <li>100ml</li>
      <li>200ml</li>
      <li>300ml</li>
      <li>400ml</li>
      <li>500ml</li>
      <div class="clears"></div>
     </ul><!--rongliang/-->
     <div class="shuliang2">
    
     </div><!--shuliang2/-->
     <div class="gc">
      @if(@Context.Session.GetString(key:"user")==null){
							 <a href="/login/index"><img src="~/images/goumai.png" width="117"  height="36" />&nbsp;&nbsp;</a>
						}else{
							
							 <a href="/zhifu/tijiao/@Model.Product.Id"><img src="~/images/goumai.png" width="117"  height="36" />&nbsp;&nbsp;</a>
							
						} 
   @*  @if(@Context.Session.GetString(key:"user")==null){
							 <a href="/login/index"><img src="~/images/gouwuche1.png" width="117"  height="36" />&nbsp;&nbsp;</a>
						}else{
							
							 <a href="/shoppingcart/index/@Model.Product.Id"><img src="~/images/gouwuche1.png" width="117"  height="36" />&nbsp;&nbsp;</a>
							
						} *@
     </div><!--gc/-->    
    </div><!--proRight/-->
    <div class="clears"></div>
    </div><!--proBox/-->
    <ul class="fangyuan">
      <li>商品描述</li>
      
      <li>商品评论</li>
     
      <div class="clears"></div>
    </ul><!--fangyuan/-->
    <div class="fangList">
    <div class="fangPar">
      商品名称： @Model.Product.Name</br>
   
   商品品牌： @Model.Product.Brand</br>
    @Model.Product.Desc</br>
     
    </div><!--fangPar/-->
   商品展示:
    </br>
  @foreach (var item in prolist)
                {
                if (@Model.ProductId==@item.Id){
                    <img src="@Model.PicUrl" width="300" height="300" /><br />         
       }
         }
                
    </div><!--fangList/-->
    <div class="fangList" style="margin-top:20px">
   @foreach (var item in proMessage)
                {
                    if (@Model.Id==@item.ProductId)
                    {
                       <div class="layui-panel">
                         <div style="padding: 32px;">用户名称：<b>@item.Name</b><span style="float:right">留言时间：@item.AskTime</span>
                         <br><br>留言内容:&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;   &nbsp;&nbsp; <span style="margin-top:10px">@item.Ask</span>
                         <br>
                                @if (item.Huifu != null)
                                {
                                    <br />
                                    <span><b>商家回复</b>:&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;@item.Huifu</span>
                                }
                            </div>
                       </div>
                    }
                }
     
    </div><!--fangList/-->
   
    <div class="fangList">
                @foreach (var item in prolist)
                {
                if (@Model.ProductId==@item.Id){
                    <img src="@Model.PicUrl" width="132" height="129" /><br /><br />             
       }
         }
                  
    
   
    </div><!--fangList/-->
   </div><!--contRight/-->
   <div class="clears"></div>
  </div><!--cont/-->
     <script>
            layui.use(function(){
 

            $("#btnAdd").on("click", function () {
                var index = layer.open({
                    type: 2,
                    content: '/fnews/add',
                    area: ["500px", "600px"]
                });
            })
});
</script>
</body>
</html>
